using System.Collections.Generic;
using System.Xml.Serialization;

namespace Commons.Injector.Dtos
{
	public class ObjectDto
	{
		[XmlAttribute(AttributeName = "id", Type = typeof(string))]
		public string Id { get; set; }

		[XmlAttribute(AttributeName = "class", Type = typeof(string))]
		public string Class { get; set; }

		[XmlAttribute(AttributeName = "factory-class", Type = typeof(string))]
		public string FactoryClass { get; set; }

		[XmlAttribute(AttributeName = "factory-method", Type = typeof(string))]
		public string FactoryMethod { get; set; }

		[XmlAttribute(AttributeName = "factory-method-generics", Type = typeof(string))]
		public string FactoryMethodGenerics { get; set; }

		[XmlAttribute(AttributeName = "init-method", Type = typeof(string))]
		public string InitMethod { get; set; }

		[XmlAttribute(AttributeName = "scope", Type = typeof(string))]
		public string Scope { get; set; }

		[XmlAttribute(AttributeName = "singleton", Type = typeof(bool))]
		public bool Singleton { get; set; }

		[XmlElement(ElementName = "constructor")]
		public ConstructorDto Constructor { get; set; }

		[XmlElement(ElementName = "property")]
		public List<PropertyDto> Properties;

		[XmlElement(ElementName = "subscription")]
		public List<SubscriptionDto> Subscriptions;

		public ObjectDto()
		{
			Scope = Context.GlobalScope;
			Singleton = true;
		}
	}
}

